<?php
namespace app\home\model;

use \think\Model;
class Test extends \think\Model{
    protected $table = 'edu_test';
    protected $pk = 'ts_id';

    /**
     * 获取已考过的试卷和答题情况！
     * 
     * @param int $student_id 学生id；
     * @return 
     * @date Sat Jun 23 22:52:49 2018
     */
    public function examed($student_id){
        $data = $this->alias('t')->field('t.*,pap.*')->join('edu_paper pap','t.pap_id = pap.pap_id')->where(['stu_id'=>$student_id])->select();
        // echo $this->getLastSql();
        return $data;
    }
}
